﻿using AutoMapper;
using Domain.Entity;
using Domain.IRepository;
using Application.Dto;

namespace AppService.CFFKService
{
    public class CFFKService : ICFFKService
	{
		private readonly IMapper mapper;
		public ICFFKRepository CFFKRepository { get; set; }

		public CFFKService(IMapper mapper, ICFFKRepository CFFKRepository)
		{
			this.mapper = mapper;
			this.CFFKRepository = CFFKRepository;
		}
		public List<CFFK> GetCFFK()
		{
			return CFFKRepository.GetCFFK();
		}

        public List<CFFK> GetfirstKindId()
        {
            return CFFKRepository.GetfirstKindId();
        }

        public bool AddCFKK(CFFKDto cFFKDto)
        {
            CFFK cFFK = mapper.Map<CFFK>(cFFKDto);
            return CFFKRepository.AddCFKK(cFFK);
        }

        public bool updateCFFK(CFFKDto cFFKDto)
        {
            CFFK cFFK = mapper.Map<CFFK>(cFFKDto);
            return CFFKRepository.updateCFFK(cFFK);
        }

        public bool DeleteCFFK(CFFKDto cFFKDto)
        {
            CFFK cFFK = mapper.Map<CFFK>(cFFKDto);
            return CFFKRepository.DeleteCFFK(cFFK);
        }
    }
}
